//
//  JMEquipmentTVController.m
//  jiMuOperate
//
//  Created by 胡梅方 on 16/4/28.
//  Copyright © 2016年 jinXinFengLi. All rights reserved.
//

#import "JMEquipmentTVController.h"
#import "JMTableVController.h"
#import "JMMyWalletTVController.h"

@interface JMEquipmentTVController ()

@end

@implementation JMEquipmentTVController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.tableView.scrollEnabled = NO;
     HIDDENNAV(NO);
     self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    UIView *view = [[UIView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 10)];
    self.tableView.tableHeaderView = view;
    self.tableView.backgroundColor = BACKCOLOR;
    self.navigationItem.title = @"装备";

}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

    return 2;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *equipCell = @"EquipCell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:equipCell];
    if (!cell) {
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:equipCell];
        
    }
    CGFloat imageH = 50;
    UIImageView *describImg = [[UIImageView alloc]initWithFrame:CGRectMake(10, 15, imageH/2, imageH/2)];
    describImg.frame = [ToolViewAndData MyAutoLayout:describImg];
    UILabel *descibLabel = [[UILabel alloc]initWithFrame:CGRectMake(imageH+10, 10, imageH*2, imageH)];
    UIButton *cellBtn = [ARC createButtonWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, imageH) Target:self Sel:@selector(cellBtnClick:)];
    cellBtn.tag = indexPath.row + BtnTag;
    [cell.contentView addSubview:cellBtn];
    descibLabel.textColor = [UIColor blackColor];
    [cell.contentView addSubview:descibLabel];
    [cell.contentView addSubview:describImg];
    cell.accessoryView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"aut_ico_arrow"]];
    UIImageView *lineImg = [[UIImageView alloc]initWithFrame:CGRectMake(0,50, 320, 1)];
    lineImg.image = [UIImage imageNamed:@"halvingline_2"];
    [cell.contentView addSubview:lineImg];
    lineImg.frame = [ToolViewAndData MyAutoLayout:lineImg];
    switch (indexPath.row) {
        case 0:
            describImg.image = [UIImage imageNamed:@"aut_ico_bank"];
            descibLabel.text = @"银行卡";
            break;
        case 1:
            describImg.image = [UIImage imageNamed:@"aut_ico_wallet"];
            descibLabel.text = @"我的钱包";
            break;
//        case 2:
//            describImg.image = [UIImage imageNamed:@"aut_ico_attention"];
//            descibLabel.text = @"我的关注";
//            break;
//        case 3:
//            describImg.image = [UIImage imageNamed:@"aut_ico_bound"];
//            descibLabel.text = @"我的绑定";
//            break;
            
        default:
            break;
        }

    [cell.contentView addSubview:[ARC createImageViewLineWithHeigt:1]];
    return cell;

}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return CELLHIGHT;
}
-(void)cellBtnClick:(UIButton*)btn
{
    switch (btn.tag-BtnTag) {
        case BankBtn:{
            JMTableVController *tv = [[JMTableVController alloc]init];
            [self.navigationController pushViewController:tv animated:YES];
            break;
        }
        case ArrowBtn:{
            JMMyWalletTVController *myWalletTV = [[JMMyWalletTVController alloc]init];
            [self.navigationController pushViewController:myWalletTV animated:YES];
            break;
        }
        case AttentionBtn:{
            JMTableVController *tv = [[JMTableVController alloc]init];
            [self.navigationController pushViewController:tv animated:YES];
            break;
        }
        case BingingBtn:{
            JMTableVController *tv = [[JMTableVController alloc]init];
            [self.navigationController pushViewController:tv animated:YES];
            break;
        }
            
            
        default:
            break;
    }
}

@end
